home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 8 / Night Owl CD-ROM (NOPV8) (Night Owl Publisher) (1993).ISO / 034a / aecur101.arj / CONTRIB / CURSES / SRC / MEMSETW.C < prev    next >
Text File  |  1991-11-04  |  572b  |  29 lines

  1. /**********************************************************************
  2.  *  
  3.  *  memsetw.c
  4.  *  
  5.  *  copyright (c) 1988,89,90 J. Alan Eldridge
  6.  *
  7.  *  memsetw() in C
  8.  *  
  9.  *  fill an array with 2-byte values
  10.  *  
  11.  *********************************************************************/
  12.  
  13. #if defined(__GNUC__)
  14. #define far
  15. #endif
  16.  
  17. void 
  18. memsetw(
  19.     void far    *buf,
  20.     void        *valp,
  21.     int         wcnt)
  22. {
  23.     short far   *wordptr = buf;
  24.     short       wordval = *(short *)valp;
  25.     
  26.     while (wcnt-- > 0)
  27.         *wordptr++ = wordval;
  28. }
  29.